package com.joint.base.service.activiti;

import com.joint.base.service.BusinessConfigService;
import com.joint.base.service.DutyService;
import com.joint.base.service.UsersService;
import org.activiti.engine.*;
import org.activiti.engine.repository.ProcessDefinition;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


@Service
public class WorkflowQueryService {


    @Resource
    protected RuntimeService runtimeService;
    @Autowired
    protected TaskService taskService;
    @Autowired
    protected RepositoryService repositoryService;
    @Autowired
    protected IdentityService identityService;
    @Autowired
    protected HistoryService historyService;

    @Resource
    protected UsersService usersService;
    @Resource
    protected DutyService dutyService;
    @Resource
    protected BusinessConfigService businessConfigService;


    /**
     * 查找最新版本的processDef
     * @return
     */
    public List<ProcessDefinition> findProcessDefinition(){
        List<ProcessDefinition> proDefinList = repositoryService.createProcessDefinitionQuery().orderByDeploymentId().active().latestVersion().desc().list();
        return proDefinList;
    }

}
